您可以通过为MajorTickOverlap(在线文档 'MajorTickOverlap 属性')属性指定一个从 0 到 1 的值,决定主刻度线标记的重叠程度。
默认值是0,这意味着没有重叠。当重叠是1,整个刻度线位于绘图区域内。对于 X-轴,当年您增加MajorTickOverlap 属性的值时,刻度线向上移动,而减少该属性的值时,刻度线向下移动。对于 Y-轴,当您增加MajorTickOverlap属性的值时,刻度线向左移动。
C# |
拷贝代码
|
---|---|
c1Chart1.Reset(true); c1Chart1.Data.Children.Add( new DataSeries() { ValuesSource = new double[] { 1, 2, 1, 2 } }); c1Chart1.ChartType = ChartType.LineSymbols; c1Chart1.View.AxisX.MajorGridStrokeThickness = 0; c1Chart1.View.AxisX.MajorTickThickness = 3; c1Chart1.View.AxisX.MajorTickHeight = 10; c1Chart1.View.AxisX.MajorTickOverlap = 0; c1Chart1.View.AxisY.MajorGridStrokeThickness = 0; c1Chart1.View.AxisY.MajorTickThickness = 3; c1Chart1.View.AxisY.MajorTickHeight = 10; c1Chart1.View.AxisY.MajorTickOverlap = 0; |
下面的图像显示MajorTickOverlap 属性的值为 0 时的结果: